package com.hashimoto.edge.test.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.hashimoto.core.remote.client.ClientConfig;
import com.hashimoto.core.remote.client.ClientType;
import com.hashimoto.core.remote.client.edge.EdgeClient;
import com.hashimoto.core.remote.client.edge.NettyEdgeClient;
import com.hashimoto.edge.test.service.EdgeCallbacTest;
@Configuration
public class BeanConfig {
	@Bean
	public EdgeClient edgeClient() {
		ClientConfig config = new ClientConfig();
		config.setClientId(124563);
		config.setConnectTimeout(300000);
		config.setPassword("123446");
		config.setUserType(ClientType.EDGE);
		config.setUsrname("12312");
		config.setRemoteHost("127.0.0.1");
		config.setRemotePort(9999);
		EdgeClient client = new NettyEdgeClient();
		client.clientConfig(config);
		client.setReceivedCallback(new EdgeCallbacTest());
		
		client.start();
		return client;
	}

}
